<template>
  <a-modal @cancel="close" title="操作记录" width="75vw" :visible="visible" unmount-on-close>
    <div class="insure-edit-content">
      <OperateLog :id="fenceId" type="15" />
    </div>
    <template #footer>
      <a-button @click="close">关闭</a-button>
      <a-button type="primary" @click="saveFn">确认</a-button>
    </template>
  </a-modal>
</template>

<script setup name="OperateLogModal">
  import { ref } from 'vue'
  // emit 事件
  const emit = defineEmits(['ok'])
  const visible = ref(false)
  const fenceId = ref('')
  // 修改
  const open = (record) => {
    visible.value = true
    fenceId.value = record.id
  }
  // 关闭
  const close = () => {
    visible.value = false
  }
  // 保存
  const saveFn = () => {
    close()
    emit('ok')
  }
  defineExpose({
    open,
  })
</script>
<style lang="less" scoped>
  .insure-edit-content {
    overflow-x: hidden;
    max-height: 80vh;
  }
</style>
